<template>
    <drag-modal title="辅助项" :visible="auxiliaryModal" @cancel="cancel" @ok="ok" :width="600" :destroyOnClose="true">
        <div class="auxiliary-wapper">
            <div class="font-size-14" v-if="accountData.isBank || accountData.isCash || accountData.isCashEquivalents">现金银行
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>银行账号 :</label>
                            <div class="filter-control">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('bank')"></div>
                                <a-input-search placeholder="请选择银行账号" v-model="formData.bankAccount" size="small" @search="handleSearch('bank')" />

                                <form-search-group ref="bank" :dynamicData="{code:'bankAccount',name:'银行账号',val:'bank',value:formData.bankAccount}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>结算方式 :</label>
                            <div class="filter-control">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('settle')"></div>
                                <a-input-search placeholder="请选择结算方式" v-model="formData.settleName" size="small" @search="handleSearch('settle')" />

                                <form-search-group ref="settle" :dynamicData="{code:'settleName',name:'结算方式',val:'clearmethod',value:formData.settleName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>票号 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.billNo" size="small"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>票据日期 :</label>
                            <div class="filter-control">
                                <a-date-picker v-model="formData.billDate" @change="onChangeDateDay" />
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isExchange && !accountData.isQuantity">外币核算
                <a-row class="condition" style="height:90px;" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>币种 :</label>
                            <div class="filter-control">
                                {{formData.currencyName}}
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>原币金额 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.currencyAmount" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>汇率 :</label>
                            <div class="filter-control">
                                <!-- <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('rate')"></div> -->
                                <a-input-search placeholder="请选择汇率" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" v-model="formData.exchangeRate" size="small" @search="handleSearch('rate')" />
                                <form-search-group ref="rate" :dynamicData="{code:'exchangeRate',name:'汇率',val:'rate',value:exchangeRate,rateId:formData.currencyId}" @clickItem="setValue"></form-search-group>

                                <!-- <a-input v-model="exchangeRate" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small"></a-input> -->
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>方向 :</label>
                            <div class="filter-control" style="padding-left: 6px;">
                                <a-radio-group v-model="formData.debitAmountType">
                                    <a-radio :value="1">借</a-radio>
                                    <a-radio :value="2">贷</a-radio>
                                </a-radio-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isQuantity && !accountData.isExchange">数量核算
                <a-row class="condition" style="height:90px;" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>数量 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.quantity" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small" :addon-after="unitName"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>单价 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.price" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>方向 :</label>
                            <div class="filter-control" style="padding-left: 6px;">
                                <a-radio-group v-model="formData.debitAmountType">
                                    <a-radio :value="1">借</a-radio>
                                    <a-radio :value="2">贷</a-radio>
                                </a-radio-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isQuantity && accountData.isExchange">外币数量核算
                <a-row class="condition" style="height:120px;" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>数量 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.quantity" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small" :addon-after="unitName"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>单价 :</label>
                            <div class="filter-control">
                                <a-input v-model="formData.price" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" size="small"></a-input>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>币种 :</label>
                            <div class="filter-control">
                                {{formData.currencyName}}
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>汇率 :</label>
                            <div class="filter-control">
                                <!-- <a-input onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" v-model="exchangeRate" size="small"></a-input> -->
                                <a-input-search placeholder="请选择汇率" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" v-model="formData.exchangeRate" size="small" @search="handleSearch('rate')" />
                                <form-search-group ref="rate" :dynamicData="{code:'exchangeRate',name:'汇率',val:'rate',value:exchangeRate,rateId:formData.currencyId}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>方向 :</label>
                            <div class="filter-control" style="padding-left: 6px;">
                                <a-radio-group v-model="formData.debitAmountType">
                                    <a-radio :value="1">借</a-radio>
                                    <a-radio :value="2">贷</a-radio>
                                </a-radio-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isAuxaccDepartment">部门
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>部门 :</label>
                            <div class="filter-control" style="position:relative;">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('office')"></div>
                                <a-input-search placeholder="请选择部门" v-model="formData.officeName" size="small" @search="handleSearch('office')" />

                                <form-search-group ref="office" :dynamicData="{code:'officeName',name:'部门',val:'office',value:formData.officeName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>

                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isAuxaccPerson">个人往来
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> 个人:</label>
                            <div class="filter-control" style="position:relative;">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('employees')"></div>
                                <a-input-search placeholder="请选择个人" v-model="formData.userName" size="small" @search="handleSearch('employees')" />

                                <form-search-group ref="employees" :dynamicData="{code:'userName',name:'个人',val:'employees',value:formData.userName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isAuxaccCustomer">客户往来
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>客户 :</label>
                            <div class="filter-control" style="position:relative;">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('crm')"></div>
                                <a-input-search placeholder="请选择客户" v-model="formData.crmName" size="small" @search="handleSearch('crm')" />

                                <form-search-group ref="crm" :dynamicData="{code:'crmName',name:'客户',val:'crm',value:formData.crmName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isAuxaccSupplier">供应商往来
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>供应商 :</label>
                            <div class="filter-control" style="position:relative;">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('supplie')"></div>
                                <a-input-search placeholder="请选择供应商" v-model="formData.vendorName" size="small" @search="handleSearch('supplie')" />

                                <form-search-group ref="supplie" :dynamicData="{code:'vendorName',name:'供应商',val:'supplie',value:formData.vendorName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
            <div class="font-size-14" v-if="accountData.isAuxaccProject">项目
                <a-row class="condition" :gutter="[8,0]">
                    <a-col :span="12">
                        <div class="filter">
                            <label class="filter-label"> <span style="color:red">*</span>项目 :</label>
                            <div class="filter-control" style="position:relative;">
                                <div style="background:rgba(0,0,0,0);width:100%;height:28px;z-index:2;position:absolute;left:0;" @click="handleSearch('project')"></div>
                                <a-input-search placeholder="请选择项目" v-model="formData.projectName" size="small" @search="handleSearch('project')" />

                                <form-search-group ref="project" :dynamicData="{code:'projectName',name:'项目',val:'project',value:formData.projectName}" @clickItem="setValue"></form-search-group>
                            </div>
                        </div>
                    </a-col>
                </a-row>
                <hr />
            </div>
        </div>

        <template slot="footer">
            <div>
                <a-button type="primary" @click="ok">确认</a-button>
                <a-button @click="cancel" class="margin-left-10">关闭</a-button>
            </div>
        </template>
    </drag-modal>
</template>
<script>
import { getById } from "@/api/erp/accounting";//科目
import FormSearchGroup from '@/components/Form/FormSearchGroup';
export default {
    props: {
        currentIndexTable: {
            type: Number,
            default: null
        },
        dataSource: {
            type: Array,
            default: []
        }
    },
    components: {
        FormSearchGroup
    },
    data () {
        return {
            auxiliaryModal: false,//辅助计量弹窗是否显示

            formData: {
                settleName: null,   //结算方式
                settleId: null,     //结算方式id
                bankAccount: null,   //银行账号
                bankId: null,        //银行id
                bankName: null,      //银行名称
                officeName: null,
                officeId: null,
                userName: null,
                userId: null,
                crmName: null,
                crmId: null,
                vendorName: null,
                vendorId: null,
                projectName: null,
                projectId: null,
                billDate: moment().format('YYYY-MM-DD'),         //票据日期
                billNo: null,           //票据号
                currencyAmount: null,   //原币金额
                currencyId: null,       //币种id
                currencyName: null,     //币种名称
                exchangeRate: null,     //汇率
                debitAmountType: 1,     //借贷方向
                quantity: null,         //数量
                price: null,            //单价
                unitId: null,           //计量单位id
                unitName: null,         //计量单位名称
            },
            isBank: false,   //是否现金，银行，等价物
            isAuxaccCustomer: false,    //是否客户核算
            isAuxaccDepartment: false,  //是否部门核算
            isAuxaccPerson: false,      //是否个人核算
            isAuxaccProject: false,     //是否项目核算
            isAuxaccSupplier: false,    //是否供应商核算
            isExchange: false,           //是否外币核算
            isQuantity: false,           //是否数量核算

            accountData: {},//当前点击行的科目详情

        }
    },
    methods: {
        show (id) {
            //根据科目id获取科目详情
            this.getAccountById(id);
        },
        cancel () {
            this.auxiliaryModal = false;
        },
        ok () {
            this.dataSource.forEach((item, index) => {
                if (index == this.currentIndexTable) {
                    //判断弹窗必填
                    // if (this.isBank) {//现金银行
                    //     if (!this.settleId || !this.billDate || !this.billNo) {
                    //         this.$message.warning('现金银行信息必须填写完整');
                    //         return;
                    //     }
                    // }
                    // if (this.isAuxaccDepartment) {//部门
                    //     if (!this.officeId) {
                    //         this.$message.warning('部门必须选择');
                    //         return;
                    //     }
                    // }
                    // if (this.isAuxaccCustomer) {//客户往来
                    //     if (!this.crmId) {
                    //         this.$message.warning('客户必须选择');
                    //         return;
                    //     }
                    // }
                    // if (this.isAuxaccPerson) {//个人
                    //     if (!this.userId) {
                    //         this.$message.warning('个人必须选择');
                    //         return;
                    //     }
                    // }
                    // if (this.isAuxaccSupplier) {//供应商往来
                    //     if (!this.vendorId) {
                    //         this.$message.warning('项目必须选择');
                    //         return;
                    //     }
                    // }
                    // if (this.isAuxaccProject) {//项目
                    //     if (!this.projectId) {
                    //         this.$message.warning('项目必须选择');
                    //         return;
                    //     }
                    // }

                    // if (this.isExchange && !this.isQuantity) {//外币核算
                    //     if (!this.currencyAmount) {
                    //         this.$message.warning('请输入原币金额');
                    //         return;
                    //     }
                    //     if (!this.exchangeRate) {
                    //         this.$message.warning('请选择汇率');
                    //         return;
                    //     }
                    // }

                    // if (this.isQuantity && !this.isExchange) {//数量核算
                    //     if (!this.quantity) {
                    //         this.$message.warning('请输入数量');
                    //         return;
                    //     }
                    //     if (!this.price) {
                    //         this.$message.warning('请输入单价');
                    //         return;
                    //     }
                    // }

                    // if (this.isQuantity && this.isExchange) {//外币数量核算
                    //     if (!this.quantity) {
                    //         this.$message.warning('请输入数量');
                    //         return;
                    //     }
                    //     if (!this.price) {
                    //         this.$message.warning('请输入单价');
                    //         return;
                    //     }
                    //     if (!this.exchangeRate) {
                    //         this.$message.warning('请选择汇率');
                    //         return;
                    //     }
                    // }

                    item = Object.assign(item, this.formData);

                    let array = [this.formData.officeName, this.formData.userName, this.formData.crmName, this.formData.projectName, this.formData.vendorName]

                    if (this.accountData.isBank || this.accountData.isCash || this.accountData.isCashEquivalents) {//现金银行
                        let xj = [this.formData.bankAccount, this.formData.settleName, this.formData.billNo, this.formData.billDate];
                        let xjFilter = xj.filter(r => {
                            return r;
                        })
                        array.unshift(xjFilter.join(','))
                    }


                    if (this.accountData.isExchange && !this.accountData.isQuantity) {//外币核算
                        let wb = [this.formData.currencyAmount, this.formData.exchangeRate, this.formData.currencyName];
                        let wbFilter = wb.filter(r => {
                            return r;
                        })
                        array.unshift(wbFilter.join(','))
                    }

                    if (this.accountData.isExchange || this.accountData.isQuantity) {//外币数量|| 数量
                        let sl = [this.formData.quantity, this.formData.price, this.formData.exchangeRate];
                        let slFilter = sl.filter(r => {
                            return r;
                        })
                        array.unshift(slFilter.join(','))
                    }

                    let b = array.filter(r => {
                        return r && r.trim();
                    })

                    item.auxiliaryItem = b.join('/');
                    console.log('辅助项：', b)

                    //计算借贷方金额
                    //calDirection: 1, //折算方式 1:原币*汇率=本位币 2:原币/汇率=本位币


                    if (this.accountData.isExchange && !this.accountData.isQuantity) {//外币核算
                        if (this.accountData.debitAmountType == 1) {
                            //借
                            if (this.accountData.calDirection == 1) {
                                item.debitAmount = (Number(this.accountData.currencyAmount) * Number(this.accountData.exchangeRate)).toFixed(2);
                            }
                            if (this.accountData.calDirection == 2) {
                                item.debitAmount = (Number(this.accountData.currencyAmount) / Number(this.accountData.exchangeRate)).toFixed(2);
                            }
                            item.creditAmount = null;
                        }

                        if (this.accountData.debitAmountType == 2) {
                            //贷
                            if (this.accountData.calDirection == 1) {
                                item.creditAmount = (Number(this.accountData.currencyAmount) * Number(this.accountData.exchangeRate)).toFixed(2);
                            }
                            if (this.accountData.calDirection == 2) {
                                item.creditAmount = (Number(this.accountData.currencyAmount) / Number(this.accountData.exchangeRate)).toFixed(2);
                            }
                            item.debitAmount = null;
                        }
                    }

                    if (!this.accountData.isExchange && this.accountData.isQuantity) {//数量核算
                        if (this.accountData.debitAmountType == 1) {
                            //借
                            item.debitAmount = (Number(this.accountData.quantity) * Number(this.accountData.price)).toFixed(2);
                            item.creditAmount = null;
                        }

                        if (this.accountData.debitAmountType == 2) {
                            //贷
                            item.creditAmount = (Number(this.accountData.quantity) * Number(this.accountData.price)).toFixed(2);
                            item.debitAmount = null;
                        }
                    }


                    if (this.accountData.isQuantity && this.accountData.isExchange) {//外币数量核算 
                        if (this.accountData.debitAmountType == 1) { //数量*单价*汇率
                            //借
                            if (this.accountData.calDirection == 1) {
                                item.debitAmount = (Number(this.formData.quantity * this.formData.price) * Number(this.formData.exchangeRate)).toFixed(2);
                            }
                            if (this.accountData.calDirection == 2) {
                                item.debitAmount = (Number(this.formData.quantity * this.formData.price) / Number(this.formData.exchangeRate)).toFixed(2);
                            }
                            item.creditAmount = null;
                        }

                        if (this.accountData.debitAmountType == 2) {//(数量*单价)/汇率
                            //贷
                            if (this.accountData.calDirection == 1) {
                                item.creditAmount = (Number(this.formData.quantity * this.formData.price) * Number(this.formData.exchangeRate)).toFixed(2);
                            }
                            if (this.accountData.calDirection == 2) {
                                item.creditAmount = (Number(this.formData.quantity * this.formData.price) / Number(this.formData.exchangeRate)).toFixed(2);
                            }
                            item.debitAmount = null;
                        }
                    }
                }
            });

            this.$emit('auxiliaryBack', this.dataSource);
            this.cancel();

            //计算合计
            // let borrow = 0;
            // let loan = 0;
            // this.dataSource.forEach(item => {
            //     if (item.debitAmount) {
            //         borrow += Number(item.debitAmount);
            //     }
            //     if (item.creditAmount) {
            //         loan += Number(item.creditAmount);
            //     }
            // });
            // this.totalDebitAmount = borrow.toFixed(2);
            // this.totalCreditAmount = loan.toFixed(2);
        },
        onChangeDateDay (v, s) {
            console.log(s)
            this.formData.billDate = s;
        },
        setValue (data) {
            console.log(data);
            if (data.codesName == 'officeName') {//部门
                this.$set(this.formData, 'officeName', data.name);
                this.$set(this.formData, 'officeId', data.id);
            }

            if (data.codesName == 'crmName') { //客户
                this.$set(this.formData, 'crmName', data.crmName);
                this.$set(this.formData, 'crmId', data.id);
            }

            if (data.codesName == 'vendorName') { //供应商
                this.$set(this.formData, 'vendorName', data.name);
                this.$set(this.formData, 'vendorId', data.id);
            }

            if (data.codesName == 'settleName') { //结算方式
                this.$set(this.formData, 'settleName', data.name);
                this.$set(this.formData, 'settleId', data.id);
            }

            if (data.codesName == 'bankAccount') { //银行账号
                this.$set(this.formData, 'bankAccount', data.bankAccount);
                this.$set(this.formData, 'bankName', data.bankName);
                this.$set(this.formData, 'bankId', data.id);
            }

            if (data.codesName == 'userName') { //个人
                this.$set(this.formData, 'userName', data.realName);
                this.$set(this.formData, 'userId', data.id);
            }

            if (data.codesName == 'projectName') { //项目
                this.$set(this.formData, 'projectName', data.name);
                this.$set(this.formData, 'projectId', data.id);
            }

            if (data.codesName == 'exchangeRate') { //汇率
                this.$set(this.formData, 'exchangeRate', data.exchangeRate);
            }
        },
        getAccountById (id) {
            //根据科目id获取科目详情
            let postData = {
                id: id,
            }
            getById(postData).then(response => {
                if (response.code === 200) {
                    this.accountData = response.data;//当前点击行的科目详情
                    let value = this.accountData;
                    if (value.isAuxaccCustomer || value.isAuxaccDepartment || value.isAuxaccPerson || value.isAuxaccProject || value.isAuxaccSupplier || value.isBank || value.isCash || value.isCashEquivalents || value.isQuantity || value.isExchange) {
                        this.auxiliaryModal = true;
                    }

                    this.dataSource.forEach((item, index) => {
                        if (index == this.currentIndexTable) {
                            console.log('当前行数据：', item);
                            this.formData = item;
                        }
                    });

                    //获取币种详情（折算方式和汇率）
                    // if (this.currencyId) {
                    //     this.getCurrencyDetailId(this.currencyId);
                    // }
                }
            }).catch(error => { });
        },
        handleSearch (n) {
            console.log(n);
            console.log(this.$refs[`${n}`]);
            this.$refs[`${n}`].showModal();
        },
        clearTipsData () {
            //清空数据
            this.currentId = null;

            this.settleName = null;
            this.settleId = null;
            this.bankAccount = null;   //银行账号
            this.bankId = null;        //银行id
            this.bankName = null;      //银行名称
            this.officeName = null;
            this.officeId = null;
            this.userName = null;
            this.userId = null;
            this.crmName = null;
            this.crmId = null;
            this.projectName = null;
            this.projectId = null;
            this.billDate = moment().format('YYYY-MM-DD');
            this.billNo = null;

            this.currencyAmount = null;   //原币金额
            this.currencyId = null;       //币种id
            this.currencyName = null;    //币种名称
            this.exchangeRate = null;    //汇率
            this.debitAmountType = 1;     //借贷方向
            this.quantity = null;        //数量
            this.price = null;           //单价
            this.unitId = null;          //计量单位id
            this.unitName = null;        //计量
        },
    }
}
</script>
<style lang="less">
</style>